#include <stdio.h>
int main()
 {
    double a = 0;
    scanf("%lf",&a);
    int b = (int)a %10 ;
    printf("%d",b);
    return 0;
}
